package com.sdo.bambooksdk;

import java.util.ArrayList;

public class DeleteAllPrivateBook {

    public static void main(String args[]) {
        int hConn = BBUtil.getConn();
        PrivBookInfo pInfo = new PrivBookInfo();
        pInfo.cbSize = pInfo.size();
        int result = BambookCore.INSTANCE.BambookGetFirstPrivBookInfo(hConn, pInfo);
        ArrayList<String> bookList=new ArrayList<String>();
        while (Const.BR_SUCC == result) {
            String bookId = (new String(pInfo.bookGuid)).trim();
            if (bookId.indexOf(".snb") > 0) {
                bookList.add(bookId);
            }
            result = BambookCore.INSTANCE.BambookGetNextPrivBookInfo(hConn, pInfo);
        }
        for(int i=0;i<bookList.size();i++){
            BambookCore.INSTANCE.BambookDeletePrivBook(hConn, bookList.get(i));
        }
        BambookCore.INSTANCE.BambookDisconnect(hConn);
    }
}
